package com.xja.webchat.service.impl;

import com.xja.webchat.entity.Chatuser;
import com.xja.webchat.mapper.ChatuserMapper;
import com.xja.webchat.service.ChatUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@Service("chatUserService")
public class ChatUserServiceImpl implements ChatUserService {
    @Autowired
    private ChatuserMapper chatuserMapper;

    @Override
    @Transactional(readOnly = true)
    public Chatuser selectUserById(Integer id) throws Exception {
        return chatuserMapper.selectByPrimaryKey(id);
    }

    @Override
    @Transactional(propagation= Propagation.REQUIRED)
    public void addChatuser(Chatuser chatuser) throws Exception {
        chatuserMapper.insertSelective(chatuser);
    }
}
